﻿/*
 * @author: wizardc
 */

using System.Collections;
using UnityEngine;

namespace Dou.Utils
{
    /// <summary>
    /// 协程工具类
    /// </summary>
    public static class CoroutineUtil
    {
        private static MonoBehaviour _behaviour;

        internal static void Init(MonoBehaviour behaviour)
        {
            _behaviour = behaviour;
        }

        public static Coroutine StartCoroutine(IEnumerator routine)
        {
            return _behaviour.StartCoroutine(routine);
        }

        public static void StopCoroutine(Coroutine routine)
        {
            _behaviour.StopCoroutine(routine);
        }

        public static void StopAllCoroutines()
        {
            _behaviour.StopAllCoroutines();
        }
    }
}
